package com.cqcvc.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author hunter
 * @since 2022-08-03
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Component
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("用户")
@ToString
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "user_id", type = IdType.AUTO)
    //@TableId(value = "user_id", type = IdType.ASSIGN_ID)
    @ApiModelProperty("用户编号")
    private Integer userId;

    @ApiModelProperty("用户账号")
    private String username;

    @ApiModelProperty("密码")
    //@JsonIgnore //前端不想显示密码，可以用此注解
    private String password;

    @ApiModelProperty("盐值")
    private String salt;

    @ApiModelProperty("用户真名")
    private String truename;

    @ApiModelProperty("性别")
    private String sex;

    @ApiModelProperty("电话")
    private String tel;

    @ApiModelProperty("头像地址")
    private String img;

    @TableField(exist = false)
    String[] roleNames;
}
